Bitcoin and Cryptocurrency Technologies
Course website | Text book(a complement to this course) | pdf
Introduction to Crypto and Cryptocurrencies
Cryptographic Hash Functions
Hash Function:
- takes any strings as input
- fixd-size output (we'll use 256bits)
- efficiently computable
Security properties:
- collision-free
- Nobody can find x ang y such that x != y and H(x)=H(y), but collision do exists.
- hiding
- Give H(x), it is infeasiable to find x.
- puzzle-friendly
- For every possible output value y, if k is chosen from a distribution with high min-entropy, then it is infeasible to find x such that H(k | x)=y.
- 就是说看x不知道H(x)是什么?这个无法从输入数据,判断到底输出是什么样子。就是说,知道输入的信息,无法一眼看出来输出的hash值是什么,谜题友好性值得就是这一点:你无法通过控制输入值x来获得想要的输出值H(x)。
SHA-256 hash function
https://sha256algorithm.com/